<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>违法代码查询</title>
    <link type="text/css" href="<c:url value='/resource/wx/newcss/common.css'/>" rel="stylesheet"/>
    <link rel="stylesheet" href="<c:url value='/resource/wechat/newcss/frozen.css'/>">
    <link rel="stylesheet" type="text/css" href="<c:url value='/resource/wechat/newcss/main.css'/>"/>
    <script type="text/javascript" src="<c:url value='/resource/wx/js/jquery-2.1.1.min.js'/>"></script>
</head>

<body ontouchstart>
    <%--<header class="ui-header ui-header-positive ui-border-b">
        <i class="ui-icon-return" onclick="history.back()"></i><h1>违法代码查询</h1>
    </header>--%>

    <section class="ui-container">
        <div class="ui-form-item ui-form-item-show ui-border-b bg_fff">
            <label for="#">
                违法代码：
            </label>
            <input id="dm" type="text" placeholder="">
        </div>

        <div class="ui-btn-wrap">
            <button id="btn_query" class="ui-btn-lg ui-btn-primary">
                查询
            </button>
        </div>

        <div id="result" style="display: none;">
        <table class="search_table">
            <tr>
                <td width="90">代码：</td>
                <td><span id="wfdm"></span></td>
            </tr>
            <tr>
                <td>违法行为：</td>
                <td><span id="wfxw"></span></td>
            </tr>
            <tr>
                <td>扣分：</td>
                <td><span id="kf"></span></td>
            </tr>
            <tr>
                <td>罚款：</td>
                <td><span id="fk"></span></td>
            </tr>
            <tr>
                <td>并罚：</td>
                <td><span id="bf"></span></td>
            </tr>
        </table>
        </div>

    </section>

<script type="text/javascript" src="<c:url value='/resource/wx/js/jquery-2.1.1.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resource/wx/js/common.js'/>"></script>
<script type="text/javascript" src="https://gaapi.jl.gov.cn/web/resource/js/os.analystic-1.1.min.js"></script>
<script type="text/javascript" src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript">
    var _preFix = getServerPreFix();

    var cid = returnCitySN["cid"];
    var cip = returnCitySN["cip"];
    var category = "${platform}";
    cid = PrefixInteger(cid,12);

    // 区域代码12位、不足前面补0
    function PrefixInteger(num, length) {
        return (Array(length).join('0') + num).slice(-length);
    }

    //日志组件初始化[必须调用]
    var logger = Oceansoft.analy.init({
        'appId': '1001',
        'regionId': cid,
        'category': category
    });

    /**
     * Form表单日志统计
     */
    function formSubmit() {

        var ss = "{'tag':'100001','category':'"+category+"','oper':'','oper_id':'','ip':'" + cip + "','title':'','ext':''}";

        logger.start();
        logger.log('100001', logger.ACTION.CREATE, ss);
        return true;
    }


    $(function () {


        $("#btn_query").click(function () {
            var dm = $("#dm").val().trim();
            //var acceptid = $("#accept_case").val().trim();
            if (dm == null || dm == "") {
                toast("请输入违法代码");
                return;
            }

            $.ajax({
                url:"<c:url value='/weixinquery/wfdm'/>",
                type: "get",
                timeout: 6000,
                data: {"dm": dm},
                /*beforeSend: function () {
                    loading("正在查询...");
                },*/
                success: function (data) {
                    if (data) {
                        $("#wfdm").html(data.dm);
                        $("#wfxw").html(data.wfxw);
                        $("#kf").html(data.kf);
                        $("#fk").html(data.fk);
                        $("#bf").html(data.bf);
                        $("#result").show();
                        finish();
                    } else {
                        finish("没有查询到相应的数据");
                    }
                    formSubmit();
                },
                error: function () {
                    $("#result").hide();
                    finish("查询失败");
                }
            });
            return false;
        });
    });

</script>
</body>
<!--<div style="width:94%; float:left; margin-left:3%; line-height:28px; font-family:'微软雅黑'; font-size:14px; color:#ff0000; position:absolute; bottom:10px;">提示说明：您可以通过本人身份证号和派出所受理窗口提供的受理号，查看身份证办理进度情况。</div>-->
</html>
